﻿using System;

namespace LogUtil
{
    public static class Log
    {
        //日志级别
        //Fatal Something bad happened; application is going down
        //Error Something failed; application may or may not continue
        //Warn Something unexpected; application will continue
        //Info Normal behavior like mail sent, user updated profile etc.
        //Debug For debugging; executed query, user authenticated, session expired
        //Trace For trace debugging; begin method X, end method X
        private static readonly NLog.Logger Logger =
            NLog.LogManager.GetCurrentClassLogger();

        public static void I(string msg)
        {
            Logger.Info(msg);
        }

        public static void I(string msg, params object[] args)
        {
            Logger.Info(msg, args);
        }

        public static void D(string msg)
        {
            Logger.Debug(msg);
        }

        public static void E(string msg)
        {
            Logger.Error(msg);
        }

        public static void E(Exception ex, string msg)
        {
            Logger.Error(ex, msg);
        }

        public static void W(string msg)
        {
            Logger.Warn(msg);
        }

        public static void T(string msg)
        {
            Logger.Trace(msg);
        }

        public static void F(string msg)
        {
            Logger.Fatal(msg);
        }
    }
}
